/**
 * 
 */
package com.star.encryption;

import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;

import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;

/**
 * @ClassName: EncClassLoader
 * @Description: TODO
 * @author http://blog.csdn.net/dianacody/article/details/38585209
 * @createtime 2014年11月28日 下午5:34:03
 * @email : jian.wang@shinsoft.net
 * @modify by TODO
 * @resaon
 * @edittime
 * @version 1.0
 * @copyright shinsoft
 */
public class EncClassLoader extends ClassLoader {

	private SecretKey key;
	private Cipher cipher;

	public EncClassLoader(SecretKey key) throws NoSuchAlgorithmException,
			NoSuchPaddingException, InvalidKeyException {
		this.key = key;
		String algorithm = "DES";
		SecureRandom sr = new SecureRandom();
		cipher = Cipher.getInstance(algorithm);
		cipher.init(Cipher.DECRYPT_MODE, this.key, sr);
	}

}
